#include<bits/stdc++.h>
using namespace std;
int n,a[100005],sum1,sum2,sum3,t,l;
vector<int> v;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d",&a[i]);
    }
    sort(a+1,a+n+1);
    a[0]=a[1];
    for(int i=1;i<=n;i++){
        if(a[i]!=a[i-1]){
            v.push_back(sum3);
            sum3=0;
        }
        sum3++;
    }
    v.push_back(sum3);
    sum3=0;
    for(int i=1;i<=n;i++){
        if(a[i]!=a[i-1]){
            sum1+=l;
            l=0;
            t++;
            if(v[t]<sum1){
                l=sum1-v[t];
            }
            sum1=0;
        }
        sum1++;
    }
    cout<<l+v[v.size()-1];
    return 0;
}
